Msg( "Loaded HGF Client HUD File.\n" )

HG.HUD = { }

/* =================================================
   H U D   C O D E   B E L O W   T H I S   L I N E
===================================================*/
local bar_w, bar_h	= SCRW/16, 28
local bar_y, bar_x 	= (SCRH/4-bar_h/2), bar_x or -bar_w
local r, g, b, a = r or 0, g or 0, b or 0, a or 200
local i_HGIcon_rot		= i_HGIcon_rot or 0
local i_HGIcon_size		= SCRW/38
local s_HGIcon 			= surface.GetTextureID( "VGUI/hg_logo1" )
local i_OutlineSize = i_OutlineSize or 1
local i_LastMoney = i_LastMoney or 0
function HG.HUD.Paint( )

	if not LocalPlayer() then return end
	
	HG.CLIENT.money = HG.CLIENT.money
	
	i_HGIcon_rot = math.sin( CurTime() / 4 ) * 64
	
	if bar_x >= 0 then
		bar_x = bar_x
	else
		bar_x = bar_x + 0.35
	end
	
	for i = 1, bar_h do
		draw.RoundedBox( 0, bar_x, bar_y + i, bar_w, 1, Color( 125,0,0,170*(i/bar_h) ) )
	end
	draw.RoundedBox( 0, bar_x, bar_y + bar_h, bar_w, 2, Color( 50,50,50,200 ) )

	surface.SetDrawColor( 255,255,255,255 )
	surface.SetTexture( s_HGIcon )
	surface.DrawTexturedRectRotated( bar_x + i_HGIcon_size/3, bar_y + bar_h/2, i_HGIcon_size, i_HGIcon_size, i_HGIcon_rot )

	draw.SimpleTextOutlined( "HG-Bux:", "UiBold", bar_x + i_HGIcon_size/4 + bar_w/2, bar_y + bar_h*(3/4), Color(200,200,200,150), 1, 1, 1, Color(255,255,255,10) )
	draw.SimpleTextOutlined( "$"..tostring(HG.CLIENT.money), "TargetID", bar_x + i_HGIcon_size/4 + (bar_w/2), bar_y + bar_h/4, Color(150,0,0,255), 1, 1, i_OutlineSize, Color(90,0,0,100) )
	
end
hook.Add("HUDPaint", "hgf_HUDPaint", HG.HUD.Paint )

// Draw our info please
hook.Add( "HUDPaint", "hfg_HUD", function()
	draw.DrawText(table.ToString(HG.CLIENT),"ConsoleText", SCRW/2, SCRH/16, Color(255,255,255,255), 0)
end)

local s_ClientData = [[]]
function HG.HUD.Debug( )
	if CONV_DEBUG:GetBool() then
		if ( LocalPlayer() and IsValid(LocalPlayer()) and HG.CLIENT ) then
			s_ClientData = HG.CLIENT or {}
			draw.DrawText(table.ToString(s_ClientData),"ConsoleText", SCRW/2, SCRH/16, Color(255,255,255,255), 0)
		end
	end
end
hook.Add("HUDPaint", "hgf_HUDDebug", HG.HUD.Debug )

function HG.HUD.OnClick( mc, v )
	if gui.MouseX() < bar_w && gui.MouseX() > bar_x then
		--if gui.MouseY() < bar_y && gui.MouseY() > bar_y + bar_h then
			if mc == MOUSE_LEFT  || mc == MOUSE_RIGHT then
				--HG.VGUI.MainMenu()
				RunConsoleCommand("hg_menu2")
			end
		--end
	end
end
hook.Add("GUIMousePressed","hgf_HUDOnClick", HG.HUD.OnClick)